package com.work.keep.entity.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.work.keep.entity.dao.Collection;
import com.work.keep.entity.dao.CollectionComments;

import com.work.keep.entity.dao.CollectionDao;
import com.work.keep.entity.dao.CollectionCommentsDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig collectionDaoConfig;
    private final DaoConfig collectionCommentsDaoConfig;

    private final CollectionDao collectionDao;
    private final CollectionCommentsDao collectionCommentsDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        collectionDaoConfig = daoConfigMap.get(CollectionDao.class).clone();
        collectionDaoConfig.initIdentityScope(type);

        collectionCommentsDaoConfig = daoConfigMap.get(CollectionCommentsDao.class).clone();
        collectionCommentsDaoConfig.initIdentityScope(type);

        collectionDao = new CollectionDao(collectionDaoConfig, this);
        collectionCommentsDao = new CollectionCommentsDao(collectionCommentsDaoConfig, this);

        registerDao(Collection.class, collectionDao);
        registerDao(CollectionComments.class, collectionCommentsDao);
    }
    
    public void clear() {
        collectionDaoConfig.getIdentityScope().clear();
        collectionCommentsDaoConfig.getIdentityScope().clear();
    }

    public CollectionDao getCollectionDao() {
        return collectionDao;
    }

    public CollectionCommentsDao getCollectionCommentsDao() {
        return collectionCommentsDao;
    }

}
